import { CommonType } from '@/common/dto/common.type';
import { CardType } from '@/modules/card/dto/card.type';
import { CourseType } from '@/modules/course/dto/course.type';
import { OrganizationType } from '@/modules/organization/dto/organization.type';
import { StudentType } from '@/modules/student/dto/student.type';
import { Field, ObjectType } from '@nestjs/graphql';

/**
 * 个人消费卡
 */
@ObjectType()
export class CardRecordType extends CommonType {
  @Field({
    description: '开始时间',
    nullable: true,
  })
  startTime: Date;

  @Field({
    description: '结束时间',
    nullable: true,
  })
  endTime: Date;

  @Field({
    description: '购买时间',
    nullable: true,
  })
  buyTime: Date;

  @Field({
    description: '剩余次数',
    nullable: true,
  })
  residueTime: number;

  @Field(() => CardType, {
    description: '关联消费卡',
    nullable: true,
  })
  card: CardType;

  @Field(() => StudentType, {
    description: '关联学员',
    nullable: true,
  })
  student: StudentType;

  @Field(() => CourseType, {
    description: '课程',
    nullable: true,
  })
  course: CourseType;

  @Field(() => OrganizationType, {
    description: '关联门店',
    nullable: true,
  })
  org: OrganizationType;
}
